<template>
  <div class="setHome">
      <div class="setList">
            <icell border 
                v-for="item in setList"
                @click.native="$router.push(item.name)"
                :key="item.name">
                <span slot="left">{{item.title}}</span>
                <i slot="right" class="iconfont icon-right"></i>
            </icell>
      </div>
      <div class="exit_btn" @click="loginOut">退出登录</div>
  </div>
</template>

<script>
    import icell from '@/components/common/icell'
    import {loginOut} from '@/http'
    import {mapGetters} from 'vuex'
    export default {
        name:'setHome',
        data(){
            return{
                setList:[
                    {name:'mySet/commonAddr',title:'常用地址',icon:''},
                    {name:'mySet/guide',title:'乘客专业指南',icon:''},
                    {name:'mySet/help',title:'帮助与反馈',icon:''},
                    {name:'mySet/legal',title:'法律条款',icon:''},
                    {name:'mySet/about',title:'关于我们',icon:''}
                ]
            }
        },
        components:{icell},
        computed:{
            ...mapGetters(['cookie','login_info'])
        },
        methods:{
            loginOut(){
                loginOut({user_id:this.login_info.user_id}).then((data)=>{
                    localStorage.login_info = null;
                    this.$msgBox({
                        title: '提示',
                        message: data.msg,
                        showCancelButton: true
                    })
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    @import '../../../../style/var.scss';
    .setHome{
        width:100%;
        height:100%;
        background:$fill_sub;
        padding:20px;
        font-size:16px;
        .setList{
            margin:20px auto;
            span{color:$font_color_primary;font-size: 16px;}
        }

        .exit_btn{
            line-height: 150px;
            background: #fff;
            text-align: center;
            color:$primary;
        }
    }
</style>

